﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;

namespace Clipper.Converters
{
    /// <summary>
    /// 上次保养提示
    /// </summary>
    [ValueConversion(typeof(int), typeof(string))]
    public class MaintainDaysTipConverter:AbstractConverters
    {
        public override object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            int days=int.Parse(value.ToString());

            if (days <= 10)
            {
                return string.Format(UIHelper.GetResourceText("MaintainDays"),days);
            }
            else if (days > 10 && days <= 30)
            {
                return string.Format(UIHelper.GetResourceText("MaintainDays"), days);
            }
            else
            {
                return string.Format(UIHelper.GetResourceText("MaintainDays"), days);
            }
        }
    }
}
